﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true"
    CodeBehind="wFrmMaterialesActualizar.aspx.cs" Inherits="Crosland.Automotriz.Web.Repuestos.wFrmMaterialesActualizar" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
    <script type="text/javascript">
        // <![CDATA[
        var fileNumber = 0;
        var fileName = "";
        var startDate = null;
        function Uploader_OnFileUploadStart() {
            startDate = new Date();
            ClearProgressInfo();

            pcProgress.Show();
        }
        function Uploader_OnFileUploadComplete(e) {
            if (e.callbackData != "")
                AddFileToContainer(e.callbackData);
        }
        function Uploader_OnFilesUploadComplete(e) {
            UpdateUploadButton();
            pcProgress.Hide();
            MostrarDatos();
        }
        function MostrarDatos() {
            btnVerDetalle.DoClick();
        }
        function UpdateUploadButton() {
            btnUpload.SetEnabled(uploader.GetText(0) != "");
        }
        // Progress Dialog

        function SetCurrentFileUploadingProgress(fileName, uploadedLength, fileLength) {
            lblFileName.SetText("Current File Progress: " + fileName);
            lblFileName.GetMainElement().title = fileName;
            lblCurrentUploadedFileLength.SetText(GetContentLengthString(uploadedLength) + " / " + GetContentLengthString(fileLength));
        }
        function SetTotalUploadingProgress(number, count, uploadedLength, totalLength) {
            lblUploadedFiles.SetText("Total Progress: " + number + ' of ' + count + " file(s)");
            lblUploadedFileLength.SetText(GetContentLengthString(uploadedLength) + " / " + GetContentLengthString(totalLength));
        }
        function ProgressChanged(args) {
            if (!pcProgress.IsVisible())
                return;
            if (args.currentFileName != fileName) {
                fileName = args.currentFileName;
                fileNumber++;
            }
            SetCurrentFileUploadingProgress(args.currentFileName, args.currentFileUploadedContentLength, args.currentFileContentLength);
            progress1.SetPosition(args.currentFileProgress);
            SetTotalUploadingProgress(fileNumber, args.fileCount, args.uploadedContentLength, args.totalContentLength);
            progress2.SetPosition(args.progress);
            UpdateProgressStatus(args.uploadedContentLength, args.totalContentLength);
        }
        function ClearProgressInfo() {
            SetCurrentFileUploadingProgress("", 0, 0);
            progress1.SetPosition(0);
            SetTotalUploadingProgress(0, 0, 0, 0);
            progress2.SetPosition(0);
            lblProgressStatus.SetText('Elapsed time: 00:00:00 &ensp; Estimated time: 00:00:00 &ensp; Speed: ' + GetContentLengthString(0) + '/s');
            fileNumber = 0;
            fileName = "";
        }
        function UpdateProgressStatus(uploadedLength, totalLength) {
            var currentDate = new Date();
            var elapsedDateMilliseconds = currentDate - startDate;
            var speed = uploadedLength / (elapsedDateMilliseconds / 1000);
            var elapsedDate = new Date(elapsedDateMilliseconds);
            var elapsedTime = GetTimeString(elapsedDate);
            var estimatedMilliseconds = Math.floor((totalLength - uploadedLength) / speed) * 1000;
            var estimatedDate = new Date(estimatedMilliseconds);
            var estimatedTime = GetTimeString(estimatedDate);
            var speed = uploadedLength / (elapsedDateMilliseconds / 1000);
            lblProgressStatus.SetText('Elapsed time: ' + elapsedTime + ' &ensp; Estimated time: ' + estimatedTime + ' &ensp; Speed: ' + GetContentLengthString(speed) + '/s');
        }
        function GetContentLengthString(contentLength) {
            var sizeDimensions = ['bytes', 'KB', 'MB', 'GB', 'TB'];
            var index = 0;
            var length = contentLength;
            var postfix = sizeDimensions[index];
            while (length > 1024) {
                length = length / 1024;
                postfix = sizeDimensions[++index];
            }
            var numberRegExpPattern = /[-+]?[0-9]*(?:\.|\,)[0-9]{0,2}|[0-9]{0,2}/;
            var results = numberRegExpPattern.exec(length);
            length = results ? results[0] : Math.floor(length);
            return length.toString() + ' ' + postfix;
        }
        function GetTimeString(date) {
            var timeRegExpPattern = /\d{1,2}:\d{1,2}:\d{1,2}/;
            var results = timeRegExpPattern.exec(date.toUTCString());
            return results ? results[0] : "00:00:00";
        }
        // ]]>
    </script>
    <div class="main-header" style="width: 100%;">
        <div class="main-titulo">
            Actualizar Materiales</div>
    </div>
    <div class="content-form" style="width: 100%;">
        <table>
            <tr>
                <td>
                    <dx:ASPxButton ID="btnGrabar" runat="server" Text="Grabar" Width="100px" OnClick="GrabarMaterial"
                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <Image Url="~/Images/save_16.gif">
                        </Image>
                    </dx:ASPxButton>
                </td>
                <td>
                    <dx:ASPxButton ID="btnSalir" runat="server" Text="Salir" Width="100px" OnClick="Salir"
                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <Image Url="~/Images/logout.png">
                        </Image>
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
        <dx:ASPxPageControl ID="ppcAdminitradorMaterial" runat="server" ActiveTabIndex="0"
            CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
            TabSpacing="0px">
            <TabPages>
                <dx:TabPage Text="Datos">
                    <ContentCollection>
                        <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <div>
                                        <div>
                                            <dx:ASPxRoundPanel ID="rpMaterial" runat="server" Width="200px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px"
                                                GroupBoxCaptionOffsetY="-19px" HeaderText="" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                ShowHeader="False">
                                                <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                                                <HeaderStyle>
                                                    <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                                                </HeaderStyle>
                                                <PanelCollection>
                                                    <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                                                        <table>
                                                            <tr>
                                                                <td>
                                                                    <dx:ASPxLabel ID="lblIdMaterial" runat="server" Visible="false">
                                                                    </dx:ASPxLabel>
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                    <dx:ASPxTextBox ID="txtidJerarquia" runat="server" ReadOnly="True" Visible="False"
                                                                        Width="1px">
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Cod Material
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxTextBox ID="txtCodMaterial" runat="server" MaxLength="30" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px" Width="220px">
                                                                        <Paddings PaddingLeft="1px" />
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td class="filas">
                                                                    Descripción
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxTextBox ID="txtDescripMaterial" runat="server" Width="300px" MaxLength="100"
                                                                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Height="30px">
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Grupo Artículo
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxComboBox ID="cboGrupoArticulo" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        IncrementalFilteringMode="Contains" CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px" AutoResizeWithContainer="True" Width="220px">
                                                                        <Columns>
                                                                            <dx:ListBoxColumn Caption="Descripción" FieldName="DES_GRUPO_ARTICULO" Width="200px" />
                                                                            <dx:ListBoxColumn Caption="Código" FieldName="COD_GRUPO_ARTICULO" Width="80px" />
                                                                        </Columns>
                                                                        <ItemStyle Height="30px" />
                                                                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                                        </LoadingPanelImage>
                                                                        <LoadingPanelStyle ImageSpacing="5px">
                                                                        </LoadingPanelStyle>
                                                                        <DropDownButton Width="20px">
                                                                        </DropDownButton>
                                                                        <ButtonStyle Width="13px">
                                                                        </ButtonStyle>
                                                                    </dx:ASPxComboBox>
                                                                </td>
                                                                <td class="filas">
                                                                    Sector
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxComboBox ID="cboSector" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        IncrementalFilteringMode="Contains" CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px" Width="170px">
                                                                        <ItemStyle Height="30px" />
                                                                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                                        </LoadingPanelImage>
                                                                        <LoadingPanelStyle ImageSpacing="5px">
                                                                        </LoadingPanelStyle>
                                                                        <DropDownButton Width="20px">
                                                                        </DropDownButton>
                                                                        <ButtonStyle Width="13px">
                                                                        </ButtonStyle>
                                                                    </dx:ASPxComboBox>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label2" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Jerarquías
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxTextBox ID="txtnomJerarquia" runat="server" Width="220px" Enabled="false"
                                                                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Height="30px">
                                                                        <Paddings PaddingLeft="5px" />
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td class="filas">
                                                                    <dx:ASPxTextBox ID="txtcodJerarquia" runat="server" Width="100px" Enabled="false"
                                                                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Height="30px">
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxButton ID="btnBuscarJerarquia" runat="server" Text="Buscar" Width="170px"
                                                                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Height="30px">
                                                                        <ClientSideEvents Click="function(s, e){PCJerarquia.Show();}" />
                                                                        <Image Url="~/Images/search.png">
                                                                        </Image>
                                                                    </dx:ASPxButton>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Nro Ruedas
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxComboBox ID="cboRuedas" runat="server" OnSelectedIndexChanged="ObtenerMarca"
                                                                        AutoPostBack="True" IncrementalFilteringMode="Contains" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px" Width="220px">
                                                                        <Items>
                                                                            <dx:ListEditItem Text="0R" Value="0R" />
                                                                            <dx:ListEditItem Text="2R" Value="2R" />
                                                                            <dx:ListEditItem Text="3R" Value="3R" />
                                                                            <dx:ListEditItem Text="4R" Value="4R" />
                                                                            <dx:ListEditItem Text="NN" Value="NN" />
                                                                        </Items>
                                                                        <ItemStyle Height="30px" />
                                                                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                                        </LoadingPanelImage>
                                                                        <LoadingPanelStyle ImageSpacing="5px">
                                                                        </LoadingPanelStyle>
                                                                        <DropDownButton Width="20px">
                                                                        </DropDownButton>
                                                                        <ButtonStyle Width="13px">
                                                                        </ButtonStyle>
                                                                    </dx:ASPxComboBox>
                                                                </td>
                                                                <td class="filas">
                                                                    Marca
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxComboBox ID="cboMarca" runat="server" Enabled="false" AutoPostBack="True"
                                                                        OnSelectedIndexChanged="ObtenerModelo" IncrementalFilteringMode="Contains" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px" Width="170px">
                                                                        <ItemStyle Height="30px" />
                                                                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                                        </LoadingPanelImage>
                                                                        <LoadingPanelStyle ImageSpacing="5px">
                                                                        </LoadingPanelStyle>
                                                                        <DropDownButton Width="20px">
                                                                        </DropDownButton>
                                                                        <ButtonStyle Width="13px">
                                                                        </ButtonStyle>
                                                                    </dx:ASPxComboBox>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="Label5" runat="server" ForeColor="Red" Text="*"></asp:Label>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Modelo
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxComboBox ID="cboModelo" runat="server" Enabled="false" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        IncrementalFilteringMode="Contains" CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        AutoPostBack="true" OnSelectedIndexChanged="ObtenerIndBaja" Height="30px" Width="220px">
                                                                        <ItemStyle Height="30px" />
                                                                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                                                        </LoadingPanelImage>
                                                                        <LoadingPanelStyle ImageSpacing="5px">
                                                                        </LoadingPanelStyle>
                                                                        <DropDownButton Width="20px">
                                                                        </DropDownButton>
                                                                        <ButtonStyle Width="13px">
                                                                        </ButtonStyle>
                                                                    </dx:ASPxComboBox>
                                                                </td>
                                                                <td class="filas">
                                                                    <dx:ASPxLabel ID="lblAnulado" runat="server" CssClass="anulado">
                                                                    </dx:ASPxLabel>
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxTextBox ID="txtIndBaja" runat="server" ReadOnly="True" Visible="False" Width="1px">
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Partida
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxTextBox ID="txtPartida" runat="server" Width="220px" MaxLength="30" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                        Height="30px">
                                                                    </dx:ASPxTextBox>
                                                                </td>
                                                                <td class="filas">
                                                                    Tipo ABC
                                                                </td>
                                                                <td>
                                                                    <dx:ASPxLabel ID="lblTipoABC" runat="server">
                                                                    </dx:ASPxLabel>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        <table>
                                                            <tr>
                                                                <td class="filas">
                                                                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" CssClass="campos_oblig" ForeColor="Red"
                                                                        Text="(*) La informacion contenida en estos casilleros sera reemplazada en una siguiente actualización por informacion proveniente del sistema SAP. Asegurese de guardar los cambios en estos casilleros tambien en el sistema SAP."
                                                                        Width="87%">
                                                                    </dx:ASPxLabel>
                                                                </td>

                                                            </tr>
                                                            <tr>
                                                            <td class="filas">
                                                            <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="(*) Campos Obligatorios" 
                                                                    CssClass="campos_oblig" ForeColor="Red">
                                                            </dx:ASPxLabel>
                                                            
                                                            </td>
                                                            
                                                            </tr>
                                                        </table>
                                                    </dx:PanelContent>
                                                </PanelCollection>
                                            </dx:ASPxRoundPanel>
                                        </div>
                                        <div>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <dx:ASPxPopupControl ID="PCJerarquia" runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css"
                                                            CssPostfix="PlasticBlue" HeaderText="Seleccione una Jerarquia" SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css"
                                                            Width="500px" ClientInstanceName="PCJerarquia" Modal="True" PopupHorizontalAlign="WindowCenter"
                                                            PopupVerticalAlign="WindowCenter">
                                                            <LoadingPanelImage Url="~/App_Themes/PlasticBlue/Web/dvLoading.gif">
                                                            </LoadingPanelImage>
                                                            <CloseButtonStyle>
                                                                <Paddings Padding="0px" />
                                                            </CloseButtonStyle>
                                                            <ContentStyle>
                                                                <BorderBottom BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" />
                                                            </ContentStyle>
                                                            <HeaderStyle>
                                                                <Paddings PaddingLeft="10px" PaddingBottom="4px" PaddingRight="4px" PaddingTop="4px" />
                                                            </HeaderStyle>
                                                            <ContentCollection>
                                                                <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td>
                                                                                <table width="100%">
                                                                                    <tr>
                                                                                        <td class="style2">
                                                                                            <asp:TextBox ID="txtBuscar" runat="server" Height="25px" Width="200px"></asp:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <dx:ASPxButton ID="btnBuscar" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                                CssPostfix="Office2010Blue" Height="25px" OnClick="btnBuscar_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                                                Text="Buscar">
                                                                                                <Image Url="~/Images/search.png">
                                                                                                </Image>
                                                                                            </dx:ASPxButton>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <dx:ASPxGridView ID="grdTD_JERARQUIA" runat="server" AutoGenerateColumns="False"
                                                                                    ClientInstanceName="grdTD_JERARQUIA" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                    CssPostfix="Office2010Blue" KeyFieldName="ID_JERARQUIA" OnAfterPerformCallback="grdTD_JERARQUIA_AfterPerformCallback"
                                                                                    OnPageIndexChanged="grdTD_JERARQUIA_PageIndexChanged" Width="100%">
                                                                                    <Columns>
                                                                                        <dx:GridViewDataTextColumn Caption="ID" FieldName="ID_JERARQUIA" ShowInCustomizationForm="True"
                                                                                            Visible="False" VisibleIndex="0">
                                                                                        </dx:GridViewDataTextColumn>
                                                                                        <dx:GridViewDataTextColumn Caption="Codigo" FieldName="COD_JERARQUIA" ShowInCustomizationForm="True"
                                                                                            VisibleIndex="1">
                                                                                        </dx:GridViewDataTextColumn>
                                                                                        <dx:GridViewDataTextColumn Caption="Descripcion" FieldName="DES_JERARQUIA" ShowInCustomizationForm="True"
                                                                                            VisibleIndex="2">
                                                                                        </dx:GridViewDataTextColumn>
                                                                                    </Columns>
                                                                                    <SettingsBehavior AllowFocusedRow="True" />
                                                                                    <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                                                        <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                                                                        </LoadingPanelOnStatusBar>
                                                                                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                                                                        </LoadingPanel>
                                                                                    </Images>
                                                                                    <ImagesFilterControl>
                                                                                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                                                                        </LoadingPanel>
                                                                                    </ImagesFilterControl>
                                                                                    <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                                                                                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                                                        </Header>
                                                                                        <LoadingPanel ImageSpacing="5px">
                                                                                        </LoadingPanel>
                                                                                    </Styles>
                                                                                    <StylesPager>
                                                                                        <PageNumber ForeColor="#3E4846">
                                                                                        </PageNumber>
                                                                                        <Summary ForeColor="#1E395B">
                                                                                        </Summary>
                                                                                    </StylesPager>
                                                                                    <StylesEditors ButtonEditCellSpacing="0">
                                                                                        <ProgressBar Height="21px">
                                                                                        </ProgressBar>
                                                                                    </StylesEditors>
                                                                                </dx:ASPxGridView>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td>
                                                                                &nbsp;
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                    <table width="100%">
                                                                        <tr>
                                                                            <td align="right">
                                                                                <dx:ASPxButton ID="btnAceptarJerarquia" runat="server" Text="Aceptar" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                                    Width="100px" OnClick="AgregarJerarquia" AutoPostBack="False">
                                                                                    <ClientSideEvents Click="function(s, e) {PCJerarquia.Hide();}" />
                                                                                    <Image Url="~/Images/ok.png">
                                                                                    </Image>
                                                                                </dx:ASPxButton>
                                                                            </td>
                                                                            <td align="right" width="105">
                                                                                <dx:ASPxButton ID="btnCancelar" runat="server" Text="Cancelar" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                    CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                                    Width="100px">
                                                                                    <ClientSideEvents Click="function(s, e) {PCJerarquia.Hide();}" />
                                                                                    <Image Url="~/Images/cancel.gif">
                                                                                    </Image>
                                                                                </dx:ASPxButton>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </dx:PopupControlContentControl>
                                                            </ContentCollection>
                                                        </dx:ASPxPopupControl>
                                                    </td>
                                                    <td valign="top">
                                                        <dx:ASPxPopupControl ID="popupmsj" runat="server" AllowDragging="True" ClientInstanceName="popupmsj"
                                                            CloseAction="None" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue"
                                                            EnableViewState="False" HeaderText="Mensaje" LoadingPanelText="Cargando&amp;hellip;"
                                                            Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
                                                            SpriteCssFilePath="~/App_Themes/PlasticBlue/{0}/sprite.css" Width="300px">
                                                            <HeaderImage Url="~/Images/icon_message.png">
                                                            </HeaderImage>
                                                            <LoadingPanelImage Url="~/App_Themes/PlasticBlue/Web/dvLoading.gif">
                                                            </LoadingPanelImage>
                                                            <CloseButtonStyle>
                                                                <Paddings Padding="0px" />
                                                            </CloseButtonStyle>
                                                            <ContentStyle>
                                                                <BorderBottom BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" />
                                                            </ContentStyle>
                                                            <HeaderStyle>
                                                                <Paddings PaddingBottom="4px" PaddingLeft="10px" PaddingRight="4px" PaddingTop="4px" />
                                                                <Paddings PaddingLeft="10px" PaddingTop="4px" PaddingRight="4px" PaddingBottom="4px" />
                                                            </HeaderStyle>
                                                            <ContentCollection>
                                                                <dx:PopupControlContentControl ID="PopupControlContentControl5" runat="server" SupportsDisabledAttribute="True">
                                                                    <br />
                                                                    <dx:ASPxPanel ID="ASPxPanel2" runat="server" DefaultButton="btCreate">
                                                                        <PanelCollection>
                                                                            <dx:PanelContent ID="Panelpopup" runat="server">
                                                                                <table align="center">
                                                                                    <tr>
                                                                                        <td colspan="2">
                                                                                            <dx:ASPxLabel ID="lblmsj" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                                CssPostfix="Office2010Blue">
                                                                                            </dx:ASPxLabel>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td colspan="2">
                                                                                            &nbsp;
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                                <table align="center">
                                                                                    <tr>
                                                                                        <td align="center" style="width: 215px">
                                                                                            <dx:ASPxButton ID="ASPxButton1" runat="server" Text="Aceptar" AutoPostBack="False"
                                                                                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                                                                <ClientSideEvents Click="function(s, e) {popupmsj.Hide();}" />
                                                                                                <Image Url="~/Images/ok.png">
                                                                                                </Image>
                                                                                            </dx:ASPxButton>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </dx:PanelContent>
                                                                        </PanelCollection>
                                                                    </dx:ASPxPanel>
                                                                </dx:PopupControlContentControl>
                                                            </ContentCollection>
                                                        </dx:ASPxPopupControl>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </dx:ContentControl>
                    </ContentCollection>
                </dx:TabPage>
                <dx:TabPage Text="Fotos">
                    <ContentCollection>
                        <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                            <dx:ASPxRoundPanel ID="rpFotoMaterial" runat="server" Width="400px" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px"
                                GroupBoxCaptionOffsetY="-19px" HeaderText="" ShowHeader="False" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                                <HeaderStyle>
                                    <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                                </HeaderStyle>
                                <PanelCollection>
                                    <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="Label4" runat="server" Text="Seleccione imagen :" Font-Names="Arial Black"
                                                        Font-Size="10pt" BorderStyle="None"></asp:Label>
                                                </td>
                                                <td>
                                                    <dx:ASPxUploadControl ID="ASPxUploadControl1" runat="server" ClientInstanceName="uploader"
                                                        Width="300px" NullText="Click here to browse files..." UploadMode="Advanced"
                                                        OnFileUploadComplete="UploadControl_FileUploadComplete" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                        CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                        <AdvancedModeSettings EnableMultiSelect="True" />
                                                        <ClientSideEvents FileUploadStart="function(s, e) { Uploader_OnFileUploadStart(); }"
                                                            FileUploadComplete="function(s, e) { Uploader_OnFileUploadComplete(e); }" FilesUploadComplete="function(s, e) { Uploader_OnFilesUploadComplete(e); }"
                                                            UploadingProgressChanged="function(s, e) { ProgressChanged(e); }" TextChanged="function(s, e) { UpdateUploadButton(); }" />
                                                        <ValidationSettings MaxFileSize="4194304" AllowedFileExtensions=".jpg,.jpeg,.jpe,.gif">
                                                        </ValidationSettings>
                                                    </dx:ASPxUploadControl>
                                                </td>
                                                <td>
                                                    <dx:ASPxButton ID="btnUpload" runat="server" AutoPostBack="False" Text="Subir" ClientInstanceName="btnUpload"
                                                        Width="100px" ClientEnabled="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                        CssPostfix="Office2010Blue" 
                                                        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                        <ClientSideEvents Click="function(s, e) { 
uploader.Upload();
}" />
                                                    </dx:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                        <table>
                                            <tr>
                                                <td>
                                                    <dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="pcProgress"
                                                        Modal="True" HeaderText="Cargando" PopupAnimationType="None" CloseAction="None"
                                                        PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" Width="460px"
                                                        AllowDragging="true" ShowPageScrollbarWhenModal="True" ShowCloseButton="False"
                                                        ShowFooter="True" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue"
                                                        EnableHotTrack="False" 
                                                        SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                                        <LoadingPanelImage Url="~/App_Themes/Office2003Blue/Web/Loading.gif">
                                                        </LoadingPanelImage>
                                                        <HeaderStyle>
                                                            <Paddings PaddingRight="6px" />
                                                        </HeaderStyle>
                                                        <FooterTemplate>
                                                            <dx:ASPxButton ID="btnCancel" runat="server" AutoPostBack="False" Text="Cancel" ClientInstanceName="btnCancel"
                                                                Width="100px" Style="float: right">
                                                                <ClientSideEvents Click="function(s, e) { uploader.Cancel(); }" />
                                                            </dx:ASPxButton>
                                                        </FooterTemplate>
                                                        <ContentCollection>
                                                            <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
                                                                <table style="width: 100%;">
                                                                    <tr>
                                                                        <td style="width: 100%;">
                                                                            <div style="overflow: hidden; width: 280px;">
                                                                                <dx:ASPxLabel ID="lblFileName" runat="server" ClientInstanceName="lblFileName" Text=""
                                                                                    Wrap="False">
                                                                                </dx:ASPxLabel>
                                                                            </div>
                                                                        </td>
                                                                        <td class="NoWrap" style="text-align: right">
                                                                            <dx:ASPxLabel ID="lblCurrentUploadedFileLength" runat="server" ClientInstanceName="lblCurrentUploadedFileLength"
                                                                                Text="" Wrap="False">
                                                                            </dx:ASPxLabel>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2" class="TopPadding">
                                                                            <dx:ASPxProgressBar ID="ASPxProgressBar1" runat="server" Height="21px" Width="100%"
                                                                                ClientInstanceName="progress1">
                                                                            </dx:ASPxProgressBar>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <div class="Spacer" style="height: 12px;">
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 100%;">
                                                                            <dx:ASPxLabel ID="lblUploadedFiles" runat="server" ClientInstanceName="lblUploadedFiles"
                                                                                Text="" Wrap="False">
                                                                            </dx:ASPxLabel>
                                                                        </td>
                                                                        <td class="NoWrap" style="text-align: right">
                                                                            <dx:ASPxLabel ID="lblUploadedFileLength" runat="server" ClientInstanceName="lblUploadedFileLength"
                                                                                Text="" Wrap="False">
                                                                            </dx:ASPxLabel>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2" class="TopPadding">
                                                                            <dx:ASPxProgressBar ID="ASPxProgressBar2" runat="server" CssClass="BottomMargin"
                                                                                Height="21px" Width="100%" ClientInstanceName="progress2">
                                                                            </dx:ASPxProgressBar>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <div class="Spacer" style="height: 12px;">
                                                                            </div>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <dx:ASPxLabel ID="lblProgressStatus" runat="server" ClientInstanceName="lblProgressStatus"
                                                                                Text="" Wrap="False">
                                                                            </dx:ASPxLabel>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </dx:PopupControlContentControl>
                                                        </ContentCollection>
                                                    </dx:ASPxPopupControl>
                                                </td>
                                            </tr>
                                        </table>
                                    </dx:PanelContent>
                                </PanelCollection>
                            </dx:ASPxRoundPanel>
                            <table>
                                <tr>
                                    <td>
                                        <dx:ASPxDataView ID="dvFotosMaterial" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" ItemSpacing="21px" PagerPanelSpacing="0px" 
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                            OnItemCommand="dvFotosMaterial_ItemCommand" RowPerPage="6">
                                            <ItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <dx:ASPxImage ID="imgCover" runat="server" Width="200px" Height="200px" ImageUrl='<%# ConfigurationManager.AppSettings["RutaFotoMaterial"]+"/"+ Eval("RUTA_IMAGEN") %>' />
                                                        </td>
                                                       <td>
                                                           <asp:CheckBox ID="CheckBox1" Checked='<%# Eval("IND_PRINCIPAL") %>' runat="server" />
                                                       
                                                       </td>
                                                       <td>
                                                       
                                                           <dx:ASPxLabel ID="txtDescripcion" runat="server" Text='<%# Eval("RUTA_IMAGEN") %>' Visible="false">
                                                           </dx:ASPxLabel>                                                        
                                                          

                                                       </td>
                                                    </tr>
                                                    <caption>
                                                        <br />
                                                        <asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete" Text="Eliminar"
                                                            CommandArgument='<%# Eval("RUTA_IMAGEN") %>' />
                                                         
                                                         
                                                    </caption>
                                                </table>
                                            </ItemTemplate>
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <DisabledStyle ForeColor="#B2B7BD">
                                            </DisabledStyle>
                                        </dx:ASPxDataView>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="btnVerDetalle" runat="server" OnClick="btnDetalle_Click" ClientVisible="false"
                                            ClientInstanceName="btnVerDetalle" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Width="1px">
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <dx:ASPxPopupControl ID="PopupMsjConfirmacion" runat="server" AllowDragging="True"
                                            ClientInstanceName="PopupMsjConfirmacion" CloseAction="CloseButton" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" EnableViewState="False" HeaderText="Mensaje"
                                            Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter"
                                            SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                            Width="300px" EnableHotTrack="False">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                                            </LoadingPanelImage>
                                            <HeaderStyle>
                                                <Paddings PaddingLeft="7px" />
                                            </HeaderStyle>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ContentCollection>
                                                <dx:PopupControlContentControl ID="PopupControlContentControl6" runat="server" SupportsDisabledAttribute="True">
                                                    <br />
                                                    <dx:ASPxPanel ID="ASPxPanel6" runat="server" DefaultButton="btCreate">
                                                        <PanelCollection>
                                                            <dx:PanelContent ID="PanelContent5" runat="server">
                                                                <table>
                                                                    <tr>
                                                                        <td colspan="3">
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;¿Estas seguro de quitar esta foto
                                                                            ?
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="3">
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td colspan="3">
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            <dx:ASPxButton ID="btnPopAceptar" runat="server" AutoPostBack="False" ClientInstanceName="btnPopAceptar"
                                                                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                                                                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Aceptar"
                                                                                Width="10px" OnClick="btnPopAceptar_Click">
                                                                                <ClientSideEvents Click="function(s, e) {
	PopupMsjConfirmacion.Hide();
	e.processOnServer = true;
}" />
                                                                            </dx:ASPxButton>
                                                                        </td>
                                                                        <td>
                                                                            <dx:ASPxButton ID="btnPopCancelar" runat="server" AutoPostBack="False" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                                                                CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                                                                Text="Cancelar" Width="10px">
                                                                                <ClientSideEvents Click="function(s, e) {
	PopupMsjConfirmacion.Hide();
}" />
                                                                            </dx:ASPxButton>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </dx:PanelContent>
                                                        </PanelCollection>
                                                    </dx:ASPxPanel>
                                                </dx:PopupControlContentControl>
                                            </ContentCollection>
                                        </dx:ASPxPopupControl>
                                    </td>
                                </tr>
                            </table>
                        </dx:ContentControl>
                    </ContentCollection>
                </dx:TabPage>
            </TabPages>
            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
            </LoadingPanelImage>
            <LoadingPanelStyle ImageSpacing="5px">
            </LoadingPanelStyle>
            <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px" />
            <ContentStyle>
                <Paddings Padding="12px" />
                <Border BorderColor="#859EBF" BorderStyle="Solid" BorderWidth="1px" />
            </ContentStyle>
        </dx:ASPxPageControl>
    </div>
</asp:Content>
